// Theme Loader for PCMod (CLIENTSIDE)

ThemeList = {}

local cnt = 0

for k, v in pairs (file.FindInLua( "themes/th_*")) do
	// Add to our count
	cnt = cnt + 1
	
	// Redefine the theme
	THEME = {}
	THEME.StartMenu = {}
	
	// Include the file
	include( "themes/" .. v )
	
	// Validate the required fields
	if (!THEME.ThemeName) then THEME.ThemeName = "Unknown" end
	if (!THEME.Author) then THEME.Author = "Unknown" end
	if (!THEME.Exists) then THEME.Exists = true end
	
	// Insert the theme
	ThemeList[ THEME.ThemeName ] = THEME
	
	// Notify the console
	Msg( "PCMod -> Theme " .. THEME.ThemeName .. " loaded!\n" )
end

Msg( "PCMod -> " .. tostring( cnt ) .. " themes loaded!\n" )

// Initialize the themes
for k, v in pairs (ThemeList) do
	v:Initialize()
end